import type { MergeDataNode } from '@/utils/permissionTree';
import { AppstoreOutlined, SettingOutlined } from '@ant-design/icons';
import React from 'react';

interface TreeSelectTitleRenderProps {
  node: MergeDataNode;
  extraElement?: React.ReactNode;
}

const TreeSelectTitleRender: React.FC<TreeSelectTitleRenderProps> = ({ node, extraElement }) => {
  const { funcType } = node;
  return (
    <div>
      <span style={{ marginRight: 2 }}>
        {funcType === '1' ? <AppstoreOutlined /> : <SettingOutlined />}
      </span>
      <span>
        {node.znName}({node.name})
      </span>
      {extraElement}
    </div>
  );
};

export default TreeSelectTitleRender;
